<script setup lang="ts">

    const emits = defineEmits<{
        (e: 'parentClick', data:number) : void,
        (e: 'parentChange'): void
    }>();

    const handleClick = () => {
        emits('parentClick', 2);   
    }

    const handleChange = () => {
        emits('parentChange');
    }

</script>

<template>
    <button @click="handleClick">点击触发handleClick事件, 并且传递数据给父组件</button>
    <div>
        点击触发handleChange事件
        <input type="checkbox" name="" id="" @change="handleChange"/>
    </div>
</template>


<style scoped lang="scss">

</style>